#include "UiVPlayerTopBar.h"
#ifdef MERGER_APP_TO_SHELL
	extern HINSTANCE g_SDHResModuleHandle;
#endif
UiVPlayerTopBar::UiVPlayerTopBar()
{
}

UiVPlayerTopBar::~UiVPlayerTopBar()
{
}

BOOL UiVPlayerTopBar::InitUiWin(void)
{
	BOOL bRtn = FALSE;
	LoadiInterItem();
	return bRtn;
}

void UiVPlayerTopBar::PaintWin(HDC hdc, RECT* prcWin, RECT* prcUpdate)
{
	m_VideoMainBG->Draw(hdc, prcWin, false, false);
}

int UiVPlayerTopBar::OnLButtonDown(UINT fwKeys, int xPos, int yPos)
{
	return UiWin::OnLButtonDown(fwKeys, xPos, yPos);

}

int UiVPlayerTopBar::OnLButtonUp(UINT fwKeys, int xPos, int yPos)
{
	return UiWin::OnLButtonUp(fwKeys, xPos, yPos);

}

void UiVPlayerTopBar::LoadiInterItem()
{
//jdhuang 20120818
#ifndef MERGER_APP_TO_SHELL
	m_VideoMainBG = ImagingHelper::GetImageObject(MzGetInstanceHandle(), 1040);
#else
	m_VideoMainBG = ImagingHelper::GetImageObject(g_SDHResModuleHandle, 7040);
#endif
	
	RECT rtBtnClose = {719, 5, 800, 59};
	m_BtnTopBar[VPLAYER_TOPBAR_CLOSE].SetPos(rtBtnClose.left, rtBtnClose.top, rtBtnClose.right-rtBtnClose.left, rtBtnClose.bottom-rtBtnClose.top);
	m_BtnTopBar[VPLAYER_TOPBAR_CLOSE].SetID(3000);
#ifndef MERGER_APP_TO_SHELL
	m_BtnTopBar[VPLAYER_TOPBAR_CLOSE].SetNormalImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1004, true));
	m_BtnTopBar[VPLAYER_TOPBAR_CLOSE].SetPressedImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1005, true));
#else
	m_BtnTopBar[VPLAYER_TOPBAR_CLOSE].SetNormalImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,7004, true));
	m_BtnTopBar[VPLAYER_TOPBAR_CLOSE].SetPressedImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,7005, true));
#endif
	AddChild(&m_BtnTopBar[VPLAYER_TOPBAR_CLOSE]);

	RECT rtBtnMenu = {0, 5, 81, 59};
	m_BtnTopBar[VPLAYER_TOPBAR_MENU].SetPos(rtBtnMenu.left, rtBtnMenu.top, rtBtnMenu.right-rtBtnMenu.left, rtBtnMenu.bottom-rtBtnMenu.top);
	m_BtnTopBar[VPLAYER_TOPBAR_MENU].SetID(3001);
#ifndef MERGER_APP_TO_SHELL
	m_BtnTopBar[VPLAYER_TOPBAR_MENU].SetNormalImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1006, true));
	m_BtnTopBar[VPLAYER_TOPBAR_MENU].SetPressedImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1007, true));
#else
	m_BtnTopBar[VPLAYER_TOPBAR_MENU].SetNormalImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,7006, true));
	m_BtnTopBar[VPLAYER_TOPBAR_MENU].SetPressedImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,7007, true));
#endif
	AddChild(&m_BtnTopBar[VPLAYER_TOPBAR_MENU]);

}

BOOL UiVPlayerTopBar::InitImages()
{
	return TRUE;
}
void UiVPlayerTopBar::UpdateLanguage()
{
}
void UiVPlayerTopBar::DeleteImages()
{
}